using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Input.Touch;
using Microsoft.Xna.Framework.Media;

namespace GameVuTru.ManagerScreens
{
    public class ManagerSound
    {
        public static bool soundOn = true;
        public ManagerSound()
        {

        }
        public static void PlaySong(Song music)
        {
            if (soundOn)
            {
                MediaPlayer.Play(music);
                if (MediaPlayer.State == MediaState.Stopped)
                    MediaPlayer.Play(music);
            }
        
        }
        public static void StopSong()
        {
            MediaPlayer.Stop();
        }
        public static void PlaySound(SoundEffect effect)
        {
            if (soundOn)
            PlaySound(effect, 1.0f);
        }
        public static void PlaySound(SoundEffect sound, float volume)
        {
            if (soundOn)
            {
                volume = Math.Min(volume, 1.0f);
                sound.Play(volume, 0.0f, 0.0f);
            }
        }
    }
}
